home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Prog / T / Think-Pascal-7.0.cpt / THINK Pascal Interfaces / CommResources.p < prev    next >
Encoding:
Text File  |  1991-04-05  |  2.8 KB  |  105 lines  |  [TEXT/PJMM]

  1. {    This file has been processed by The THINK Pascal Source Converter, v1.1.    }
  2.  
  3. {
  4.     CommResources.p
  5.     Pascal Interface to the Communications Resource Manager
  6.     
  7.     Copyright © Apple Computer, Inc. 1988-90
  8.     All rights reserved
  9. }
  10. {$IFC UNDEFINED UsingIncludes}
  11. {$SETC UsingIncludes := 0}
  12. {$ENDC}
  13.  
  14.  
  15.     UNIT CommResources;
  16.     INTERFACE USES    Types, OSUtils;
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. CONST
  32. {    current version of the CRM }
  33.     curCRMVersion     =     2;
  34.     
  35.  
  36. {    tool classes (also the tool file types)    }
  37.     classCM         =    'cbnd';
  38.     classFT         =    'fbnd';
  39.     classTM            =    'tbnd';
  40.     
  41. {    constants general to the use of the Communications Resource Manager }
  42.     crmType         =     9;                {queueType}
  43.     crmRecVersion    =     1;                {version of queue data structure}
  44.  
  45. {    error codes }
  46.     crmGenericError    =    -1;
  47.     crmNoErr        =    0;
  48.     
  49. TYPE
  50. {    data structures general to the use of the Communications Resource Manager }
  51.     CRMErr            =    OSErr;
  52.  
  53.     CRMRecPtr         = ^CRMRec;
  54.     CRMRec             = RECORD
  55.         qLink:             QElemPtr;      {reserved}
  56.         qType:             INTEGER;      {queue type -- ORD(crmType) = 9}
  57.         crmVersion:     INTEGER;    {version of queue element data structure}
  58.         crmPrivate:     LONGINT;    {reserved}
  59.         crmReserved:     INTEGER;       {reserved}
  60.         
  61.         crmDeviceType:     LONGINT;    {type of device, assigned by DTS}
  62.         crmDeviceID:     LONGINT;    {device ID; assigned when CRMInstall is called}
  63.         crmAttributes:     LONGINT;    {pointer to attribute block}
  64.                                     {device specific}
  65.         crmStatus:         LONGINT;    {status variable - device specific}
  66.  
  67.         crmRefCon:         LONGINT;    {for device private use}
  68.         END;
  69.  
  70. FUNCTION     InitCRM : CRMErr;
  71. FUNCTION     CRMGetHeader: QHdrPtr;
  72. PROCEDURE     CRMInstall(crmReqPtr: QElemPtr);
  73. FUNCTION     CRMRemove(crmReqPtr: QElemPtr): OSErr;
  74. FUNCTION     CRMSearch(crmReqPtr: QElemPtr): QElemPtr;    
  75. FUNCTION     CRMGetCRMVersion : INTEGER;
  76.  
  77. FUNCTION     CRMGetResource(theType : ResType; theID : INTEGER) : Handle;
  78. FUNCTION     CRMGet1Resource(theType : ResType; theID : INTEGER) : Handle;
  79. FUNCTION     CRMGetIndResource(theType : ResType; index : INTEGER) : Handle;
  80. FUNCTION     CRMGet1IndResource(theType : ResType; index : INTEGER) : Handle;
  81. FUNCTION     CRMGetNamedResource(theType : ResType; name : Str255) : Handle;
  82. FUNCTION     CRMGet1NamedResource(theType : ResType; name : Str255) : Handle;
  83. PROCEDURE     CRMReleaseResource(theHandle : Handle);
  84. FUNCTION     CRMGetIndex(theHandle: Handle): LONGINT;
  85.  
  86. FUNCTION     CRMLocalToRealID( bundleType:ResType; 
  87.                     toolID:INTEGER; theKind:ResType; localID:INTEGER) : INTEGER;
  88. FUNCTION     CRMRealToLocalID( bundleType:ResType; 
  89.                     toolID:INTEGER; theKind:ResType; realID:INTEGER) : INTEGER;
  90.                     
  91. FUNCTION    CRMGetIndToolName(bundleType: OSType; index: INTEGER; VAR toolName: Str255): OSErr;
  92.  
  93. FUNCTION    CRMFindCommunications(VAR vRefNum: INTEGER; VAR dirID: LONGINT): OSErr;
  94.  
  95. FUNCTION     CRMGetToolResource(procID: INTEGER; theType: ResType; theID: INTEGER): Handle;
  96. PROCEDURE     CRMReleaseToolResource(procID: INTEGER; theHandle: Handle);
  97.  
  98.  {UsingCommResources}
  99.  
  100.  
  101.     IMPLEMENTATION
  102. END.
  103.  
  104.  
  105.